﻿@{
    
    string table = Request.QueryString["table"];
    string connid = Request.QueryString["connid"];
    
    if(table.IsNullOrEmpty() || !connid.IsGuid() || !Check.CheckLogin() || !Check.CheckUrl())
    {
        Response.Write("[]");
        Response.End();
    }
    List<string> fields = new Business.Platform.DBConnection().GetFields(connid.ToGuid(), table);
    System.Text.StringBuilder sb = new System.Text.StringBuilder("[", 1000);
    
    foreach (string field in fields)
    {
        sb.Append("{\"name\":");
        sb.AppendFormat("\"{0}\"", field);
        sb.Append("},");
    }
    Response.Write(sb.ToString().TrimEnd(',') + "]");
    Response.End();
}